<template>
	<div>
		123
		<!-- 选项卡 -->
		<button @click="init === 'A'">加载A</button>
		<button @click="init === 'B'">加载B</button>
		<!-- <A v-if="init === 'A'"></A>
	<B v-if="init === 'B'"></B> -->
		<!-- 动态加载组件 -->
		<component v-bind:is="init"></component>
	</div>
</template>

<script>
import A from './A'
import B from './B'
export default {
	data() {
		return {
			init: 'A',
		}
	},
	components: { A, B },
}
</script>

<style>
</style>